package com.che.software.testato.domain.entity;

import java.io.Serializable;

/**
 * Class representing an item.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class Item implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = -6821689091408004682L;

	/**
	 * Members.
	 */
	private boolean exclusive;
	private int actionPlanId, itemId, maxIterationNumber, sourceIntentionId, targetIntentionId, testCaseId;
	private String label, sourceIntentionLabel, targetIntentionLabel;

	/**
	 * Checks if the item has been refined based on the actionPlanId value.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return true if the item has been refined, else false.
	 * @since July, 2011.
	 */
	public boolean isRefined() {
		return 0 != actionPlanId;
	}

	/**
	 * Checks if the item has been operationalized based on the testCaseId
	 * value.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @return true if the item has been operationalized, else false
	 * @since July, 2011.
	 */
	public boolean isOperationalized() {
		return 0 != testCaseId;
	}

	/**
	 * Getter for the private field value actionPlanId.
	 * 
	 * @return the actionPlanId field value.
	 */
	public int getActionPlanId() {
		return actionPlanId;
	}

	/**
	 * Setting a value to the actionPlanId field.
	 * 
	 * @param actionPlanId the value to set.
	 */
	public void setActionPlanId(int actionPlanId) {
		this.actionPlanId = actionPlanId;
	}

	/**
	 * Getter for the private field value itemId.
	 * 
	 * @return the itemId field value.
	 */
	public int getItemId() {
		return itemId;
	}

	/**
	 * Setting a value to the itemId field.
	 * 
	 * @param itemId the value to set.
	 */
	public void setItemId(int itemId) {
		this.itemId = itemId;
	}

	/**
	 * Getter for the private field value maxIterationNumber.
	 * 
	 * @return the maxIterationNumber field value.
	 */
	public int getMaxIterationNumber() {
		return maxIterationNumber;
	}

	/**
	 * Setting a value to the maxIterationNumber field.
	 * 
	 * @param maxIterationNumber the value to set.
	 */
	public void setMaxIterationNumber(int maxIterationNumber) {
		this.maxIterationNumber = maxIterationNumber;
	}

	/**
	 * Getter for the private field value testCaseId.
	 * 
	 * @return the testCaseId field value.
	 */
	public int getTestCaseId() {
		return testCaseId;
	}

	/**
	 * Setting a value to the testCaseId field.
	 * 
	 * @param testCaseId the value to set.
	 */
	public void setTestCaseId(int testCaseId) {
		this.testCaseId = testCaseId;
	}

	/**
	 * Getter for the private field value label.
	 * 
	 * @return the label field value.
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * Setting a value to the label field.
	 * 
	 * @param label the value to set.
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/**
	 * Getter for the private field value sourceIntentionLabel.
	 * 
	 * @return the sourceIntentionLabel field value.
	 */
	public String getSourceIntentionLabel() {
		return sourceIntentionLabel;
	}

	/**
	 * Setting a value to the sourceIntentionLabel field.
	 * 
	 * @param sourceIntentionLabel the value to set.
	 */
	public void setSourceIntentionLabel(String sourceIntentionLabel) {
		this.sourceIntentionLabel = sourceIntentionLabel;
	}

	/**
	 * Getter for the private field value targetIntentionLabel.
	 * 
	 * @return the targetIntentionLabel field value.
	 */
	public String getTargetIntentionLabel() {
		return targetIntentionLabel;
	}

	/**
	 * Setting a value to the targetIntentionLabel field.
	 * 
	 * @param targetIntentionLabel the value to set.
	 */
	public void setTargetIntentionLabel(String targetIntentionLabel) {
		this.targetIntentionLabel = targetIntentionLabel;
	}

	/**
	 * Getter for the private field value exclusive.
	 * 
	 * @return the exclusive field value.
	 */
	public boolean isExclusive() {
		return exclusive;
	}

	/**
	 * Setting a value to the exclusive field.
	 * 
	 * @param exclusive the value to set.
	 */
	public void setExclusive(boolean exclusive) {
		this.exclusive = exclusive;
	}

	/**
	 * Getter for the private field value sourceIntentionId.
	 * 
	 * @return the sourceIntentionId field value.
	 */
	public int getSourceIntentionId() {
		return sourceIntentionId;
	}

	/**
	 * Setting a value to the sourceIntentionId field.
	 * 
	 * @param sourceIntentionId the value to set.
	 */
	public void setSourceIntentionId(int sourceIntentionId) {
		this.sourceIntentionId = sourceIntentionId;
	}

	/**
	 * Getter for the private field value targetIntentionId.
	 * 
	 * @return the targetIntentionId field value.
	 */
	public int getTargetIntentionId() {
		return targetIntentionId;
	}

	/**
	 * Setting a value to the targetIntentionId field.
	 * 
	 * @param targetIntentionId the value to set.
	 */
	public void setTargetIntentionId(int targetIntentionId) {
		this.targetIntentionId = targetIntentionId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return label;
	}
}